package ru.rchervot.sanasar.client.gin;

import ru.rchervot.sanasar.client.view.FactoryHeaderViewDefault;
import ru.rchervot.sanasar.client.view.RootPresenter;
import ru.rchervot.sanasar.client.view.RootPresenterDefault;
import ru.rchervot.sanasar.client.view.RootViewDefault;

import com.google.gwt.event.shared.HandlerManager;
import com.google.inject.Inject;
import com.google.inject.Provider;

public class ProviderRootPresenter implements Provider<RootPresenter> {
	@Inject HandlerManager eventBus;
	
	@Override
	public RootPresenter get() {
		RootPresenter.Display v = new RootViewDefault(
				new FactoryHeaderViewDefault(eventBus));
		RootPresenter p = new RootPresenterDefault(v);
		p.bindDisplay();
		
		return p;
	}
}